How can I fix the `NameError` caused by using variables defined in different functions

visit shbcf.ru